package com.genexususa.eo.bing.data.wsSubclasses;

import com.genexususa.eo.bing.CampaignManagementServiceClasses.BusinessTarget;
import com.genexususa.eo.bing.CampaignManagementServiceClasses.BusinessTargetBid;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;

public class GxBusinessTarget extends BusinessTarget {
    public GxBusinessTarget(Element element) {
        NodeList bidsNode = element.getElementsByTagName("BusinessTargetBidCollection");
        if (bidsNode.getLength() > 0) {
            NodeList businessTargetBidNode = ((Element)bidsNode.item(0)).getElementsByTagName("BusinessTargetBid");
            BusinessTargetBid[] businessTargetBids = new BusinessTargetBid[businessTargetBidNode.getLength()];
            for (int temp = 0; temp < businessTargetBidNode.getLength(); temp++) {
                businessTargetBids[temp] = new GxBusinessTargetBid((Element)businessTargetBidNode.item(temp));
            }
            this.setBids(businessTargetBids);
        }
    }
}
